<?php
/**
 * 管理员助手函数
 */
class admin_helper
{
    /**
     * 获取当前登录的admin_id
     * @return int
     */
    public static function get_admin_id()
    {
        static $static_admin_id = NULL;
        if ($static_admin_id === NULL) {
            $static_admin_id = session('admin_id') ? session('admin_id') : 0;
        }
        return $static_admin_id;
    }
    
    /**
     * 获取管理员昵称
     * @return string
     */
    public static function get_nick_name($admin_id = null)
    {
        if (!$admin_id) {
            $admin_id = SELF::get_admin_id();
        } 
        
        return _uri('admin', $admin_id, 'nick_name');
    }

}
?>